<?php

namespace backend\modules\Sys;

use Yii;
use backend\components\Module as BaseModule;

class Module extends BaseModule {

    public $permission = "P_System";
    public $controllerNamespace = 'backend\modules\Sys\controllers';

    public function checkAccess() {
        if (strpos(Yii::$app->requestedRoute, 'common-resource')) {
            return true;
        }
        parent::checkAccess();
    }

    public function init() {
        parent::init();
        $this->modules = [
            'admin' => ['class' => 'backend\modules\Sys\modules\Admin\Module'],
            'rbac' => ['class' => 'backend\modules\Sys\modules\Rbac\Module'],
            'common-resource' => ['class' => 'backend\modules\Sys\modules\CommonResource\Module'],
        ];
        // custom initialization code goes here
    }

}
